import java.sql.Timestamp;
import java.util.Comparator;

public class RecommendComparator implements Comparator<Comment> {
    public int compare(Comment c1, Comment c2) {
        Timestamp current = new Timestamp(System.currentTimeMillis());
        double score1 = c1.getLikeCount() / (double)(current.getTime() - c1.getTimestamp().getTime());
        double score2 = c2.getLikeCount() / (double)(current.getTime() - c2.getTimestamp().getTime());
        return Double.compare(score2, score1);
    }
}
